﻿using Autofac;
using PLC.Application;
using PLC.EntityFrameworkCore;
using PLCWpfTest.Common;
using YWM;
using YWM.DependencyInjection;

namespace PLCWpfTest
{
    [DependsOn(
        typeof(PLCApplicationModule),
        typeof(PLCEntityFrameworkCoreModule)
     )]
    public class PLCModule : BaseModule
    {
        public override void Initialize()
        {
            ContainerBuilder.RegisterAssemblyTypes(GetType().Assembly).AsImplementedInterfaces().AsSelf().InstancePerDependency();
            ContainerBuilder.RegisterGeneric(typeof(RelayCommand<>), typeof(RelayCommand<>));
            ContainerBuilder.RegisterGeneric(typeof(AsyncRelayCommand<>), typeof(AsyncRelayCommand<>));
        }
    }
}
